home *** CD-ROM | disk | FTP | other *** search
/ Quick PC 61 / Quick PC 61.iso / I386 / WMS.CAB / server.asp < prev    next >
Encoding:
Text File  |  2003-02-21  |  2.2 KB  |  70 lines

  1. ∩╗┐<%@ Language=VBScript CODEPAGE=65001 %>
  2. <!--#include file="include/wmsConstants.inc"-->
  3. <!--#include file="include/wmsLocStrings.inc"-->
  4. <!--#include file="include/wmsCommon.inc"-->
  5. <%
  6. '+-------------------------------------------------------------------------
  7. '
  8. '  Microsoft Windows Media
  9. '  Copyright (C) Microsoft Corporation. All rights reserved.
  10. '
  11. '  File:       Server.asp
  12. '
  13. '  Contents:    Serves as a redirect for the standard frameset.
  14. '
  15. '--------------------------------------------------------------------------
  16.  
  17. '//////////////////////////////////////////////////////////////////////////  
  18. Function GetCurrentPage( szServerName )  
  19.     Dim curPageDictionary
  20.     Dim szUrl
  21.     szUrl = ""
  22.     
  23.     Set curPageDictionary = Session( "CurrentPage" )
  24.     
  25.     if( IsEmpty( curPageDictionary ) ) then
  26.         Set curPageDictionary = Server.CreateObject("Scripting.Dictionary")
  27.     
  28.         Set Session( "CurrentPage" ) = curPageDictionary
  29.         curPageDictionary.Add "default", "server_status.asp"
  30.         curPageDictionary.Add UCase( szServerName ), "server_status.asp"
  31.         szUrl = "server_status.asp"
  32.     else
  33.         if( curPageDictionary.Exists( szServerName ) ) then
  34.             szUrl = curPageDictionary( szServerName )
  35.         else
  36.             curPageDictionary.Add UCase( szServerName ), "server_status.asp"
  37.             szUrl = "server_status.asp"
  38.         end if
  39.     end if
  40.     
  41.     dwOffset = InStr( szUrl, ",+" )
  42.     if( dwOffset ) then
  43.         szUrl = Left( szUrl, dwOffset )
  44.     end if
  45.     GetCurrentPage = szUrl
  46.     exit function
  47. End Function
  48.  
  49. Dim strCurrentPage
  50. Dim strServer
  51. Dim dwResult
  52.  
  53. strServer = RemoveDangerousCharacters( UCase( Request.QueryString( "server" ) ) )
  54. if( 0 >= Len( strServer ) ) then
  55.     strServer = "Default"
  56. end if
  57.  
  58. strCurrentPage = GetCurrentPage( strServer )
  59.  
  60. dwResult = InStr( 1, strCurrentPage, "server=", vbTextCompare )
  61. Dim strFinalUrl
  62. if( ( 0 = dwResult ) or ( null = dwResult ) ) then 
  63.     strFinalUrl = strCurrentPage & "?server=" & RemoveDangerousCharacters( strServer )
  64. else
  65.     strFinalUrl = strCurrentPage
  66. end if  
  67. strFinalUrl = Replace( strFinalUrl, chr( 34 ), "", 1, -1, vbTextCompare )
  68. Response.Redirect( strFinalUrl )
  69.  
  70. %>